<template>
  <div class="content">
    <div class="content-main">
      <div class="left-content">
        <span class="content-title">{{ detailsData.title }}</span>
        <span class="type-btn" @click="back">返回列表</span>
      </div>
      <div class="left-content-info" v-html="detailsData.describe"></div>
    </div>
  </div>
</template>
<script setup>
import { useRouter, useRoute } from 'vue-router'
// import { centerIntroductoryStore } from '@/store/centerIntroductoryDetails'
import { cmsCentreBlurbDetailsDetail } from '@/api'
const router = useRouter()
function back() {
  router.go(-1)
}
const detailsData = ref({})
const route = useRoute()
onMounted(() => {
  cmsCentreBlurbDetailsDetail({
    id: route.query.id
  }).then(({ data }) => {
    switch (route.query.type) {
      case 'detectionServiceModels':
        detailsData.value = data?.detectionServiceModels[route.query.index]
        break
      case 'appraisalServiceModels':
        detailsData.value = data?.appraisalServiceModels[route.query.index]
        break
      case 'measuringStandardModels':
        detailsData.value = data?.measuringStandardModels[route.query.index]
    }
  })
})
</script>
<style lang="scss" scoped>
.content {
  background-color: #f6faff;
  padding-top: 20px;
  padding-bottom: 20px;
}

.content-main {
  width: 1200px;
  margin: auto;
  background-color: #fff;

  .left-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 40px;
    padding: 20px;
    border-bottom: 1px solid #e5e5e5;

    .content-title {
      font-size: 20px;
      font-weight: 600;
      color: #333333;
    }

    .type-btn {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 78px;
      height: 28px;
      background: #e4efff;
      font-size: 14px;
      border-radius: 50px;
      color: #333333;
      cursor: pointer;
    }
  }

  .left-content-info {
    width: auto;
    height: 800px;
    padding: 20px;
    overflow: auto;
    background-color: #fff;
  }
}
</style>
